home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************
- "event.c"
-
- by John A. Love, III [ Washington Apple Pi Users' Group]
-
- using Symantec's "THINK C", v 5.00
- *********************************************************/
-
-
- #ifndef __BALLOONS__
- #include <Balloons.h>
- #endif
-
- #ifndef __EPPC__
- #include <EPPC.h>
- #endif
-
- #include <CType.h>
-
- #include "protos"
-
- #include "globals.h"
- #include "extern.h"
-
- #include "about.h"
- #include "ADBLights.h"
- #include "floatingWindow.h"
-
-
-
- void DrawContents (WindowPtr window); // Local Prototype.
-
-
- Boolean aDlgEvent;
- long Sleep;
- extern DialogPtr helpPtr;
- extern Rect List_Rect, Scroller_Rect;
- extern ListHandle my_List_Handle;
- extern HelpTopic topics[MAX_TOPICS];
- extern short Current_Topic, lastHit;
- extern TEHandle myTEHandle;
- extern ControlHandle hScrollBar;
- extern ViewMode Last_Type;
- extern Boolean newStyle;
- extern short currentTopLine;
- extern WindowPeek frontToolWindow,
- backToolWindow,
- frontDocWindow;
-
-
-
-
- void MainEventLoop (void) {
-
- Boolean ignore;
- WindowPtr TheWindow;
- short windowLoc;
-
-
- Sleep = GetCaretTime();
-
- while (!gDone) {
-
- if (gWNE) ignore = WaitNextEvent(everyEvent, &gEvent, Sleep, nil);
- else ignore = GetNextEvent(everyEvent, &gEvent);
-
- /*
- ** We need to call IsDialogEvent here in order that:
- ** 1) our modeless Help Window receive null events.
- ** 2) the Help Manager process the HelpItem specified
- ** in the Help Window's DITL resource.
- **
- ** NOTE: We call DialogSelect within HandleMouse(...) and test
- ** for (helpPtr != nil) in our other event-related routines
- ** such as HandleKey(...). As a result, we do NOT call
- ** DialogSelect here before the switch statement.
- */
- aDlgEvent = IsDialogEvent(&gEvent);
- // if (aDlgEvent) aDlgEvent = DialogSelect(&gEvent, &helpPtr, &itemHit);
-
- switch (gEvent.what) {
-
- case nullEvent:
- DoPeriodic();
- // An odd-ball here just for auto-key line arrows:
- if ( isActive(helpPtr) && (Last_Type == text) )
- HiliteControl(hScrollBar, drawCntl);
- break;
-
- case mouseDown:
- /* Fills in 'TheWindow': */
- windowLoc = FindWindow(gEvent.where, &TheWindow);
- HandleMouse(&gEvent, TheWindow, windowLoc);
-
- case mouseUp: break;
-
- case keyDown:
- case autoKey:
- HandleKey(&gEvent); // Then, fall thru ...
-
- case keyUp: break;
-
- case updateEvt:
- HandleUpdate((WindowPtr) gEvent.message);
-
- case diskEvt: break;
-
- case activateEvt:
- HandleActivate((WindowPtr) gEvent.message);
-
- case networkEvt:
- case driverEvt: break;
-
- case app1Evt:
- case app2Evt:
- case app3Evt: break;
-
- case osEvt: /* MultiFinder Event = app4Evt */
-
- switch (gEvent.message >> 24) { /* High byte */
-
- case mouseMovedMessage: break; // See HandleCursor().
-
- case suspendResumeMessage:
-
- if (gEvent.message & resumeFlag) {
- gInForeGround = true;
- ResetBalloons(gSaveBalloons);
- gBalloonsUp = gSaveBalloons;
- TResume();
- } /* Resume */
-
- else {
- gInForeGround = false;
-
- /* Remember, deActivate & Activate Events generally
- ** come in pairs, with deActivate first in line.
- ** SO ... we hide the silly things and re-show them
- ** after the Resume partner has finished. */
-
- gSaveBalloons = gBalloonsUp; // Where we're at !!!
- ResetBalloons(gStartBalloons); // On Day Numero Uno !!!
- TSuspend();
- }; /* Suspend */
-
- } /* switch (gEvent.message >> 24) */
-
- break; /* MultiFinder Event */
-
- case kHighLevelEvent:
-
- HideBalloons(gBalloonsUp); /* ... because of my Alert Dialog. */
- if (HelpManagerActive())
- if (HMGetHelpMenuHandle(&gHelpMenu) == noErr)
- if (gHelpMenu != nil)
- /* Disable "Show Balloons": */
- DisableItem(gHelpMenu, kHMShowBalloonsItem);
-
- DoHighLevelEvent(&gEvent);
-
- ShowBalloons(gBalloonsUp);
- if (HelpManagerActive())
- if (HMGetHelpMenuHandle(&gHelpMenu) == noErr)
- if (gHelpMenu != nil)
- /* Reset it: */
- EnableItem(gHelpMenu, kHMShowBalloonsItem);
-
- default: break;
-
- } /* switch (gEvent.what) */
-
- } /* !gDone */
-
- } /* MainEventLoop */
-
-
-
- void HandleMouse (EventRecord *event, WindowPtr window, short part) {
-
- short whatHit, thePart, itemHit, nCols;
- Point myPt;
- Boolean DoubleClick;
- Cell cellHit; // Cell = a Point.
- ControlHandle hControl;
- short oldValue;
-
-
- switch (part) {
-
- case inContent:
-
- if ( ((WindowPeek)window)->hilited == false ) {
- TSelectWindow(window);
- return;
- }
-
- if (window == (WindowPtr)frontDocWindow) {
-
- if (window == helpPtr)
- {
-
- /* Oh Oh ... _IsDialogEvent and _DialogSelect both test
- ** for our Dialog being the front window. BUT ... with a
- ** floating window(s), the latter is the REAL front window.
- ** SO ... on with the trickery !!! */
-
- /* I coulda used:
- ** savedWindowList = WindowList;
- **
- ** This did work, though I really don't know why ???
- ** ... at least it worked UNTIL I incorporated
- ** Balloon Help and then the Floating Window
- ** got overwritten: */
-
- WindowPtr savedGhostWindow = GhostWindow;
- Boolean alreadyRestored = false;
-
- if (backToolWindow) GhostWindow = (WindowPtr) backToolWindow;
-
- if ( IsDialogEvent(event) &&
- DialogSelect(event, &helpPtr, &whatHit) ) {
- myPt = event->where;
- GlobalToLocal(&myPt);
-
- if (whatHit == OK_Button) {
- GhostWindow = savedGhostWindow;
- alreadyRestored = true;
- Kill_Help_Window();
- }
-
- else if ((whatHit == Next_Button) || (whatHit == Prev_Button))
- H_Scroll_Picture(whatHit);
-
- else if ( PtInRect(myPt, &List_Rect) ) {
- DoubleClick = LClick(myPt, event->modifiers,
- my_List_Handle);
- cellHit = LLastClick(my_List_Handle);
- nCols = (**my_List_Handle).dataBounds.right;
- itemHit = cellHit.v * nCols;
- if ((itemHit != lastHit) &&
- PtInRect(cellHit, &(**my_List_Handle).dataBounds)) {
- lastHit = itemHit;
- H_Handle_List_Event(itemHit);
- }
- }
-
- else if ( PtInRect(myPt, &Scroller_Rect)
- &&
- (topics[Current_Topic].screen_mode == text) ) {
- thePart = FindControl(myPt, helpPtr, &hControl);
- oldValue = GetCtlValue(hControl);
- switch (thePart) {
-
- case inThumb:
- if ( TrackControl(hControl, myPt, nil) ) {
- H_Scroll_Text(oldValue,
- GetCtlValue(hControl));
- currentTopLine = GetLineNbr(newStyle,
- myTEHandle,
- (**myTEHandle).viewRect.top -
- (**myTEHandle).destRect.top);
- }
- break;
-
- case inUpButton: case inDownButton:
- case inPageUp: case inPageDown:
- TrackControl(hControl, myPt,
- (ProcPtr)&H_Scroll_Filter);
-
- } /* end switch (thePart) */
- }
-
- } /* DialogSelect */
-
- if (!alreadyRestored) GhostWindow = savedGhostWindow;
-
- } /* in content of HELP Window */
-
- else /* in another window */ {
-
-
-
- } /* NOT in HELP Window */
-
- } /* in frontDocWindow */
-
- else if (window == (WindowPtr)frontToolWindow) {
-
- if (helpPtr == nil)
- Create_Help();
- else if (helpPtr != (WindowPtr)frontDocWindow)
- TSelectWindow(helpPtr);
-
- } /* in frontToolWindow */
-
- else if (TGetWKind((WindowPeek)window) == toolKind)
- /* Clicked in a Tool Window in back somewhere.
- ** ... remember, ALL floating Tool Windows are
- ** hilited unless we're suspended or a DA is
- ** active in the foreground (under System 6).
- ** Therefore, our starting test for non-hiliting
- ** would NOT have been triggered. */
- TSelectWindow(window);
-
- /* Clicked in back Document Window -- see start of inContent.
- DAs are handled by case = inSysWindow.
- else TSelectWindow(window); */
-
- break; /* inContent */
-
- case inDrag:
- TDragWindow(window, event);
- break;
-
- case inGoAway:
- if (TrackGoAway(window, event->where))
- if (window == helpPtr) Kill_Help_Window();
- else TCloseWindow(window);
- break;
-
- case inGrow:
- {
- Rect growRect, updateRect;
- long newSize;
-
-
- // List's Grow Icon there ONLY for appearances:
- if ( isActive(helpPtr) &&
- PtInRect((**my_List_Handle).mouseLoc, &List_Rect) ) break;
-
- growRect = (**GetGrayRgn()).rgnBBox; // ... even multiple screens.
- GlobalLocal(&growRect);
- InsetRect(&growRect, scrollWidth, scrollHeight),
-
- newSize = GrowWindow(window, event->where, &growRect);
- if (newSize == 0) break;
-
- /* ALL of the following just to avoid that pesky (ARRGH !!!)
- ** double re-draw of the Scroll Bars. [See _ValidRect within
- ** "Inside Macintosh"] In addition, note that we start out
- ** by erasing the grow box because upon enlarging the window,
- ** the grow icon remains drawn where it used to be just for a
- ** split second until _BeginUpdate ... _EndUpdate gets around
- ** to erasing it. */
-
- updateRect = window->portRect;
- updateRect.left = updateRect.right + frame - growBoxSize;
- updateRect.top = updateRect.bottom + frame - growBoxSize;
- EraseRect(&updateRect);
-
- InvalidScroll(window);
- SizeWindow(window, LoWord(newSize), HiWord(newSize), true);
- ScrollResize(window);
- ValidScroll(window);
- }
-
- break; /* inGrow */
-
- case inMenuBar: /* Process mouse menu command (if any). */
- HandleMenu(event);
- break;
-
- case inSysWindow: /* Let the system handle the mouseDown. */
- SystemClick(event, window);
- break;
-
- case inZoomIn:
- case inZoomOut:
- DoZoom(window, part);
-
- } /* end switch (part) */
-
- } /* HandleMouse */
-
-
-
- void HandleKey (EventRecord *event) {
-
- short cmd, option, code;
- char key;
- ControlHandle okButton, bCtl;
- short bType;
- Handle bHandle;
- Rect bBox;
- Cell firstCell = {0,0}, currCell, nextCell;
-
-
- cmd = event->modifiers & cmdKey;
- option = event->modifiers & optionKey;
- key = event->message & charCodeMask;
- code = (event->message & keyCodeMask) >> 8; /* ... into low byte. */
-
- if ( isActive(helpPtr) ) {
-
- if ( (key == '\r') || (key == Enter) || (cmd && (key == '.')) ) {
- okButton = GetDefaultButton(helpPtr);
- SimulateClick(okButton);
- Kill_Help_Window();
- } /* <CR>, <Enter> or CMD-period */
-
- else if (cmd) { /* NOT CMD-period ... just tested for. */
- /* Covers the case = <CMD-Option>: */
-
- // Keycodes for Mac Plus keyboard, then for all others:
- if ( (code == 0x46) || (code == 0x7B) ) /* Left Arrow */ {
- GetDItem(helpPtr, Prev_Button, &bType, &bHandle, &bBox);
- bCtl = (ControlHandle)bHandle;
- if (
- (**bCtl).contrlVis && // Hidden when in <Text> mode.
- ((**bCtl).contrlHilite == ON )
- ) H_Scroll_Picture(Prev_Button);
- else SysBeep(10);
- }
- else if ( (code == 0x42) || (code == 0x7C) ) /* Right Arrow */ {
- GetDItem(helpPtr, Next_Button, &bType, &bHandle, &bBox);
- bCtl = (ControlHandle)bHandle;
- if (
- (**bCtl).contrlVis &&
- ((**bCtl).contrlHilite == ON )
- ) H_Scroll_Picture(Next_Button);
- else SysBeep(10);
- }
- else HandleMenu(event);
-
- } /* end ... NOT CMD-period */
-
- else /* NOT the CMD-key */ {
-
- short oldValue, scrollLine, newValue, min, max;
- long finalTicks;
- extern short maxTopLine;
- Cell one;
- extern Cell lastCell;
- short dRows, dCols, nCols;
- Boolean vNext = true, hNext;
-
-
- nCols = (**my_List_Handle).dataBounds.right;
- hNext = nCols > 1;
-
- if ( (code == 0x4D) || (code == 0x7E) ) /* Up Arrow */ {
-
- if (option) { /* Scroll List */
-
- currCell = firstCell;
-
- if ( !LGetSelect(true, // next = false means THIS Cell.
- &currCell,
- my_List_Handle) ) {
- // nothing to de-select.
- nextCell = firstCell;
- }
- else {
-
- LSetSelect(false, currCell, my_List_Handle);
-
- if ( EqualPt(currCell, firstCell) ) {
- nextCell = lastCell;
- }
- else { // Too bad there's NOT a routine LPrevCell() ?!*!?
- nextCell = currCell; /* Start where we left off. */
- ;
- if (currCell.h == 0) /* in first column */ {
- dRows = -1;
- dCols = nCols - 1;
- }
- else /* over one or more columns */ {
- dRows = 0;
- dCols = -1;
- }
- SetPt(&one, dCols, dRows);
- ;
- /* Adding a negative # = subtracting a positive one: */
- AddPt(one, &nextCell);
- } /* end: currCell != firstCell */
-
- } /* end: a Cell is already selected */
-
- LSetSelect(true, nextCell, my_List_Handle);
-
- if ( !PtInRect(nextCell, &(**my_List_Handle).visible) )
- LAutoScroll(my_List_Handle);
-
- H_Handle_List_Event(nextCell.v * nCols);
-
- } /* end: scrolling list */
-
- else if ( (Last_Type == text) &&
- /* 'tis active */
- ((*hScrollBar)->contrlMax > 0) ) { /* Scroll Text */
-
- min = GetCtlMin(hScrollBar);
- max = GetCtlMax(hScrollBar);
- oldValue = GetCtlValue(hScrollBar);
- scrollLine = GetLineHeight(newStyle, myTEHandle, currentTopLine);
- newValue = oldValue - scrollLine;
- if (newValue <= min) {
- newValue = min;
- currentTopLine = 1;
- }
- else --currentTopLine;
- ;
- if (newValue != oldValue) { /* Avoid blinking Thumb. */
- HiliteControl(hScrollBar, inUpButton);
- ;
- SetCtlValue(hScrollBar, newValue);
- Delay(4, &finalTicks);
- H_Scroll_Text(oldValue, newValue);
- ;
- // Keep hilited for autoKey Event:
- if (event->what == keyDown)
- HiliteControl(hScrollBar, drawCntl);
- }
- else {
- HiliteControl(hScrollBar, drawCntl);
- SysBeep(10);
- }
-
- } /* end: scrolling text */
-
- } /* end: Up Arrow */
-
- else if ( (code == 0x48) || (code == 0x7D) ) /* Down Arrow */ {
-
- if (option) { /* Scroll List */
-
- currCell = firstCell;
-
- if ( !LGetSelect(true, // next = false means THIS Cell.
- &currCell,
- my_List_Handle) ) {
- // nothing to de-select.
- nextCell = firstCell;
- }
- else {
- LSetSelect(false, currCell, my_List_Handle);
- ;
- nextCell = currCell; /* Start where we left off. */
- if ( !LNextCell(hNext,
- vNext,
- &nextCell,
- my_List_Handle) )
- nextCell = firstCell;
- }
-
- LSetSelect(true, nextCell, my_List_Handle);
-
- if ( !PtInRect(nextCell, &(**my_List_Handle).visible) )
- LAutoScroll(my_List_Handle);
-
- H_Handle_List_Event(nextCell.v * nCols);
-
- } /* end: scrolling list */
-
- else if ( (Last_Type == text) &&
- ((*hScrollBar)->contrlMax > 0) ) { /* Scroll Text */
-
- min = GetCtlMin(hScrollBar);
- max = GetCtlMax(hScrollBar);
- oldValue = GetCtlValue(hScrollBar);
- scrollLine = GetLineHeight(newStyle, myTEHandle, currentTopLine);
- newValue = oldValue + scrollLine;
- if (newValue >= max) {
- newValue = max;
- currentTopLine = maxTopLine;
- }
- else currentTopLine++;
- ;
- if (newValue != oldValue) { /* Avoid blinking Thumb. */
- HiliteControl(hScrollBar, inDownButton);
- ;
- SetCtlValue(hScrollBar, newValue);
- Delay(4, &finalTicks);
- H_Scroll_Text(oldValue, newValue);
- ;
- if (event->what == keyDown) // Keep hilited for autoKey.
- HiliteControl(hScrollBar, drawCntl);
- }
- else {
- HiliteControl(hScrollBar, drawCntl);
- SysBeep(10);
- }
-
- } /* end: scrolling text */
-
- } /* end: Down Arrow */
-
- else /* a regular character */ {
-
- short dataLen = 255, nCell, iCell;
- char contents[255]; /* WITHOUT length byte. */
- extern short pageCells;
- Boolean found = false, cellSelected;
- short Help = 0x72,
- Home = 0x73, End = 0x77,
- PageUp = 0x74, PageDown = 0x79;
-
-
- currCell = firstCell;
- cellSelected = LGetSelect(true, &currCell, my_List_Handle);
-
- if (code == Help)
- nextCell = currCell;
-
- else if (code == Home)
- nextCell = firstCell;
-
- else if (code == End)
- nextCell = lastCell;
-
- else if (code == PageUp) {
- SetPt(&nextCell, currCell.h, currCell.v - pageCells);
- if ((nextCell.h < firstCell.h) || (nextCell.v < firstCell.v))
- nextCell = firstCell;
- }
-
- else if (code == PageDown) {
- SetPt(&nextCell, currCell.h, currCell.v + pageCells);
- if ((nextCell.h > lastCell.h) || (nextCell.v > lastCell.v))
- nextCell = lastCell;
- }
-
- else {
-
- nCell = (lastCell.v + 1) * nCols;
- while (!found) {
-
- nextCell = currCell; /* Begin where we left off. */
- for (iCell = 1; iCell <= nCell; iCell++) {
- LGetCell(contents, &dataLen, nextCell, my_List_Handle);
- /* If the input is NOT a letter, then we
- ** advance to the NEXT available letter. */
- if ( cmpAlpha (key, contents[0]) ) {
- found = true; // So we exit the while-loop
- break; // after we exit the for-loop.
- }
- if ( !LNextCell(hNext, vNext, &nextCell, my_List_Handle) )
- // Start over:
- nextCell = firstCell;
- } /* end: for-loop */
-
- /* Okay ... we've cycled around the list once.
- ** Let's do it again with the next available letter.
- ** Note that we again start where we left off
- ** EACH time through the while-loop. */
- key = nextAlpha(key);
-
- } /* while NOT found */
-
- } /* end: NOT Home, End etc. */
-
- if (cellSelected) {
- if (!EqualPt(nextCell, currCell)) {
- LSetSelect(false, currCell, my_List_Handle);
- LSetSelect(true, nextCell, my_List_Handle);
- if ( !PtInRect(nextCell, &(**my_List_Handle).visible) )
- LAutoScroll(my_List_Handle);
- H_Handle_List_Event(nextCell.v * nCols);
- }
- }
- else /* Nothing selected */ {
- LSetSelect(true, nextCell, my_List_Handle);
- if ( !PtInRect(nextCell, &(**my_List_Handle).visible) )
- LAutoScroll(my_List_Handle);
- H_Handle_List_Event(nextCell.v * nCols);
- }
-
- } /* end ... a regular character */
-
- } /* end ... NOT the CMD-key */
-
- } /* end ... active Help Window */
-
- // By testing for the Help key before the CMD-key, we cover the
- // instance = CMD-Help. Also, we do NOT need to test for an
- // Extended keyboard before looking for the Help key because the
- // code = 0x72 is an ADDITION to prior keyboards:
-
- else if (code == 0x72) {
- if (helpPtr == nil) Create_Help();
- else if (helpPtr != (WindowPtr)frontDocWindow) TSelectWindow(helpPtr);
- }
-
- else if (cmd) {
- if (key == '/') { /* CMD-? */
- if (helpPtr == nil) Create_Help();
- else if (helpPtr != (WindowPtr)frontDocWindow) TSelectWindow(helpPtr);
- }
- else HandleMenu(event);
- }
-
- else { /* a regular ole' window */
-
-
- } /* a regular window */
-
- } /* HandleKey */
-
-
-
- /* ====================================================
- ** HandleUpdate re-draws any controls, text, or PICTs
- ** as well as the Grow Icon and Window Menu Bar if any.
- ** ==================================================== */
-
- void HandleUpdate (WindowPtr window) {
-
- GrafPtr savedPort; // Must be local parms because windows
- // are updated in front-to-back order.
-
-
- GetPort(&savedPort); // Save stuff ...
- SetPort(window);
-
- BeginUpdate(window);
- ;
- DrawContents(window);
- ;
- EndUpdate(window);
-
- SetPort(savedPort); /* Reset stuff ... */
-
- } /* HandleUpdate */
-
-
-
- void DrawContents (WindowPtr window) {
-
-
- ClipRect(&window->portRect);
-
- if (window == helpPtr) H_Handle_Update();
- else {
- EraseRect(&window->portRect);
- DrawControls(window);
- if ( hasGrowIcon(window) ) DrawGrowIcon(window);
-
-
-
-
- } /* NOT Help Window */
-
- } /* DrawContents */
-
-
-
- void HandleActivate (WindowPtr window) {
-
-
- SetPort(window);
-
- if (gEvent.modifiers & activeFlag) DoActivate(window);
- else DoDeactivate(window);
-
- PeriodicMenus(); /* Crisper appearance if here also. */
-
- } /* HandleActivate */
-
-
-
- /* -----------------------------------------------
- ** Need to separate them because we're trying to
- ** make this blasted thing MultiFinder-compatible:
- ** ----------------------------------------------- */
-
- void DoActivate (WindowPtr window) {
-
- short theWKind;
-
-
- SetPort(window);
-
- theWKind = TGetWKind((WindowPeek)window);
-
- if (theWKind == userKind) {
-
- if (window == helpPtr) {
- if (Last_Type == text) {
- if (myTEHandle != nil) TEActivate(myTEHandle);
- if (hScrollBar != nil) HiliteControl(hScrollBar, ON);
- }
- LActivate(true, my_List_Handle);
-
- H_DrawGrowIcon(my_List_Handle);
-
- FrameDefaultButton(helpPtr);
- }
- else /* NOT Pillera's Help Window */ {
-
-
- }
-
- } /* end: userKind */
-
- else if (theWKind == toolKind)
- /* This will NEVER be called here because we are either
- ** creating a brand new Tool Window OR we are clicking
- ** in a non-hilited Tool Window (because we have a DA
- ** in the foreground under System 6 we are de-activating)
- ** OR we are clicking in some back Tool Window. In the
- ** first instance, TShowWindow calls TSelectWindow directly.
- ** In the other instances, HandleMouse also calls
- ** TSelectWindow directly.
-
- TSelectWindow(window); */
- ;
-
- else /* systemKind */ {
-
- /* DAs do their own thing !! */
-
- }
-
- } /* DoActivate */
-
-
-
- void DoDeactivate (WindowPtr window) {
-
- short theWKind;
-
-
- theWKind = TGetWKind((WindowPeek)window);
-
- if (theWKind == userKind) {
-
- if (window == helpPtr) {
- if (Last_Type == text) {
- if (myTEHandle != nil) TEDeactivate(myTEHandle);
- if (hScrollBar != nil) HiliteControl(hScrollBar, OFF);
- }
- LActivate(false, my_List_Handle);
-
- H_DrawGrowIcon(my_List_Handle);
-
- FrameDefaultButton(helpPtr);
- }
- else {
-
-
- } /* NOT Pillera's Help Window */
-
- } /* end: userKind */
-
- else if (theWKind == toolKind) {
- /* Called ONLY when a DA is activated into the
- ** foreground (under System 6, with the <Option>
- ** key pressed as you open the DA). */
-
- THiliteTools(false);
- if (frontDocWindow) {
- HiliteWindow((WindowPtr)frontDocWindow, false);
- DoDeactivate((WindowPtr)frontDocWindow);
- }
-
- }
-
- else /* systemKind */ {
-
- // DAs do their own thing !!
-
- } /* end: systemKind */
-
- } /* DoDeactivate */
-
-
-
- void DoHighLevelEvent (EventRecord *event) {
- /* Simply calls AEProcessAppleEvent and reports any errors to the client.
- AEProcessAppleEvent looks in its table of registered events and sees if
- the current event is registered. If so, it calls the routine associated
- with that event. */
-
- OSErr err;
-
-
- if (gInitAppleEvents == noErr) err = AEProcessAppleEvent(event);
-
- } /* DoHighLevelEvent */
-
-
-
-
- /* { end file "event.c" } */
-